/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package FarmacieDAL;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "DETALII_CHITANTA")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DetaliiChitanta.findAll", query = "SELECT d FROM DetaliiChitanta d"),
    @NamedQuery(name = "DetaliiChitanta.findByIdDetaliichitanta", query = "SELECT d FROM DetaliiChitanta d WHERE d.idDetaliichitanta = :idDetaliichitanta")})
public class DetaliiChitanta implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_DETALIICHITANTA")
    private Integer idDetaliichitanta;
    @JoinColumn(name = "ID_VANZARE", referencedColumnName = "ID_VANZARE")
    @ManyToOne
    private Vanzari idVanzare;
    @JoinColumn(name = "ID_CHITANTA", referencedColumnName = "ID_CHITANTA")
    @ManyToOne(optional = false)
    private Chitanta idChitanta;

    public DetaliiChitanta() {
    }

    public DetaliiChitanta(Integer idDetaliichitanta) {
        this.idDetaliichitanta = idDetaliichitanta;
    }

    public Integer getIdDetaliichitanta() {
        return idDetaliichitanta;
    }

    public void setIdDetaliichitanta(Integer idDetaliichitanta) {
        this.idDetaliichitanta = idDetaliichitanta;
    }

    public Vanzari getIdVanzare() {
        return idVanzare;
    }

    public void setIdVanzare(Vanzari idVanzare) {
        this.idVanzare = idVanzare;
    }

    public Chitanta getIdChitanta() {
        return idChitanta;
    }

    public void setIdChitanta(Chitanta idChitanta) {
        this.idChitanta = idChitanta;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDetaliichitanta != null ? idDetaliichitanta.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DetaliiChitanta)) {
            return false;
        }
        DetaliiChitanta other = (DetaliiChitanta) object;
        if ((this.idDetaliichitanta == null && other.idDetaliichitanta != null) || (this.idDetaliichitanta != null && !this.idDetaliichitanta.equals(other.idDetaliichitanta))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "FarmacieDAL.DetaliiChitanta[ idDetaliichitanta=" + idDetaliichitanta + " ]";
    }
    
}
